import numpy as np
import dask.dataframe as dd


taxes = dd.read_csv("FY2016-STC-Category-Table.csv", sep=";", blocksize=5)
taxes['Geo_Name'] = taxes['Geo_Name'].map_partitions(lambda x: x.str.lower())
df = taxes.compute()
# 将DataFrame转换为字典，并使用列表推导式将每个Geo_Name分组转换为数组
df_dict = {geo_name: [{'Tax_Type': tax_type, 'Amount': amount} for tax_type, amount in zip(df.loc[df['Geo_Name'] == geo_name]['Tax_Type'], df.loc[df['Geo_Name'] == geo_name]['Amount'])]
           for geo_name in df['Geo_Name'].unique()}

print(df_dict)

print(zip(df.loc[df['Geo_Name'] == 'a']['Tax_Type'], df.loc[df['Geo_Name'] == 'a']['Amount']))
